home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 3 / Info_Mac_1994-01.iso / Development / Information / Mac Programming Secrets 1.0.1 / Read Me Or Die
Text File  |  1992-05-19  |  2KB  |  38 lines

  1. Dear consumer:
  2.  
  3. Thanks for forking over the bucks for this Fine Disk. I hope you enjoy it. And we appreciate it.
  4.  
  5. Due to some oversights no doubt caused by the publisher, there were a few errors in the source code published in the book. Those errors have been fixed and the changes are included on the Fine Disk you have just copied onto your hard disk and then tossed on your heap of floppies to be recycled. This document lists those errors and the fixes.
  6.  
  7. p. 208: SaveBackground()
  8. ----------------------
  9. If there are no application windows to be preserved, coveredWagon will be an empty region and coveredRect will be an empty rectangle. If this rectangle is then passed to CreateOffWorld, an invalid offscreen graphics world will be created (the authors might have noticed that if they hadn’t been so cocky and actually checked the result code returned by NewGWorld()). The solution is to check for an empty save region before trying to save it. In SaveBackground(), the following changes were made:
  10.  
  11.     coveredWagon = GetCoveredArea(w);
  12.     if (!EmptyRgn(coveredWagon)) {                                // this line added
  13.         coveredRect = (**coveredWagon).rgnBBox;
  14.  ...
  15.         (***savedData).offWorld = offWorld;
  16.     } else {                                                                     // this line added
  17.         *savedData = NIL;                                                  // this line added
  18.     }                                                                              // this line added
  19.  
  20. To balance this out, we must make a change to RestoreBackground. If nothing was saved in SaveBackground, then nothing needs to be restored:
  21.  
  22.     if (savedData != NIL) {                                             // this line added
  23.         coveredRect = (**(**savedData).coveredArea).rgnBBox;
  24. ...
  25.         DisposeHandle((Handle) savedData);
  26.     }                                                                              // this line added
  27.  
  28.  
  29. p. 450: MyMenuKey()
  30. ------------------
  31. During development, MyMenuKey() contained the following line:
  32.  
  33.     result = (*oldMenuKeyAddress)(ch);
  34.  
  35. See page 406 if you don’t believe me. However, shortly before going to press, a green monster broke into the computer in the middle of the night and converted this line from K&R syntax to ANSI syntax. In the process, the monster removed one of the s’s from oldMenuKeyAddress. The line should read:
  36.  
  37.     result = oldMenuKeyAddress(ch);
  38.